package com.shengde.jinwawaforleader.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.SystemClock;

import com.shengde.jinwawaforleader.R;

public class WelcomeActivity extends Activity {
    //是否手动退出当前界面
    private boolean isfinish;
    private WelcomeActivity instance;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        instance = this;
        init();
    }

    private void init() {
        new Thread(){
            public void run(){
                SystemClock.sleep(2000);
                if(!isfinish) {
                    Intent intent = new Intent(instance, MainActivity.class);
                    startActivity(intent);
                    finish();
                }
            }
        }.start();
    }

    @Override
    protected void onDestroy() {
        isfinish = true;
        super.onDestroy();
    }
}
